//
//  LSRNewViewController.m
//  BaiSiProject
//
//  Created by lshenrong on 16/7/3.
//  Copyright © 2016年 lshenrong. All rights reserved.
//

#import "LSRNewViewController.h"
#import "LSRTagViewController.h"
#import "LSRAllViewController.h"
#import "LSRVideoViewController.h"
#import "LSRVoiceViewController.h"
#import "LSRPictureiewController.h"
#import "LSRTextViewController.h"

@interface LSRNewViewController ()

@end

@implementation LSRNewViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    [self setNavigationBar];
    
    //设置所有子控制器
    [self setUpTopChildControllers];

       
   
}
#pragma mark--setUpTopChildControllers

-(void)setUpTopChildControllers
{
    /*#import "LSRAllViewController.h"
     #import "LSRVideoViewController.h"
     #import "LSRVoiceViewController.h"
     #import "LSRPictureiewController.h"
     #import "LSRTextViewController.h"
     */
    //添加all控制器
    LSRAllViewController *VC0=[[LSRAllViewController alloc] init];
    [self addChildViewController:VC0];
    VC0.title=@"全部";
    //添加all控制器
    LSRVideoViewController *VC1=[[LSRVideoViewController alloc] init];
    [self addChildViewController:VC1];
    VC1.title=@"视频";
    //添加all控制器
    LSRVoiceViewController *VC2=[[LSRVoiceViewController alloc] init];
    [self addChildViewController:VC2];
    VC2.title=@"声音";
    //添加all控制器
    LSRPictureiewController *VC3=[[LSRPictureiewController alloc] init];
    [self addChildViewController:VC3];
    VC3.title=@"图片";
    //添加all控制器
    LSRTextViewController *VC4=[[LSRTextViewController alloc] init];
    [self addChildViewController:VC4];
    VC4.title=@"段子";
}

-(void)setNavigationBar
{

    UIImageView *imageView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"MainTitle"]];
    self.navigationItem.titleView=imageView;
    
    //设置左边的item,按钮用customView
      self.navigationItem.leftBarButtonItem=[UIBarButtonItem  itemWithimage:[UIImage imageNamed:@"MainTagSubIcon"] highlightImage:[UIImage imageNamed:@"MainTagSubIconClick"] Target:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    



}
-(void)click
{
    LSRTagViewController *tagVC=[[LSRTagViewController alloc] init];
    
    
    tagVC.hidesBottomBarWhenPushed=YES;
    [self.navigationController pushViewController:tagVC animated:YES];
    NSLog(@"%s",__func__);


}

@end
